#define _CRT_SECURE_NO_WARNINGS 1
//https://leetcode-cn.com/problems/intersection-of-two-linked-lists/description/
struct ListNode* getIntersectionNode(struct ListNode* headA, struct ListNode* headB) {
    struct ListNode* pA = headA;
    struct ListNode* pB = headB;

    while (pA != pB) {
        pA = pA ? pA->next : headB;
        pB = pB ? pB->next : headA;
    }

    return pA;
}